package com.tencent.iov.cowin.befsale.clue.controller.clue.assembler;

import com.tencent.iov.cowin.befsale.clue.controller.clue.vo.request.AddClueInitialRequest;
import com.tencent.iov.cowin.befsale.clue.domain.clue.po.ClueInitial;
import com.software.boot.common.model.dao.BaseAssembler;
import com.software.boot.common.model.rest.BaseRequest;
import com.software.boot.common.model.rest.BaseResponse;
import com.software.common.config.SearchLocalHeader;
import com.software.common.enums.SCRMRequestHeaderEnum;
import lombok.extern.slf4j.Slf4j;

/**
 * @Author: whp
 * @Date: 2021-12-21 16:16:13
 * @Description: 线索源信息表适配器，负责vo<->entity、vo<->po的转换和必要的参数检查，行为
 */
@Slf4j
public class ClueInitialAssembler extends BaseAssembler<BaseResponse, BaseRequest, ClueInitial> {
    public static AddClueInitialRequest initAddClueInitialRequest(AddClueInitialRequest request){
        request.setCorpId(SearchLocalHeader.getHeader(SCRMRequestHeaderEnum.HEADER_CORP_ACCOUNTID.getCode()));
        request.setTenantId(SearchLocalHeader.getHeader(SCRMRequestHeaderEnum.HEADER_TENANTID.getCode()));
        request.setCreatedBy(SearchLocalHeader.getHeader(SCRMRequestHeaderEnum.HEADER_EMP_ID.getCode()));
        request.setCreatedName(SearchLocalHeader.getHeader(SCRMRequestHeaderEnum.HEADER_EMP_NAME.getCode()));
        request.setDealerId(SearchLocalHeader.getHeader(SCRMRequestHeaderEnum.HEADER_DEALER_ID.getCode()));
        request.setFollowEmpId(Long.valueOf(SearchLocalHeader.getHeader(SCRMRequestHeaderEnum.HEADER_EMP_ID.getCode())));
        return request;
    }
}
